
             
/**
 * 
 *
 * @File name:  QueryTCheckInfoByPagerAction.java 
 * @Create on:  2011-12-04 10:49:615
 * @Author   :  许福辉
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.usual.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.po.ComboPager;
import cn.boho.framework.po.Pager;
import cn.boho.framework.service.MessageService;

import com.boho.base.dao.DaoHelper;
import com.boho.common.Constant;
import com.boho.estates.usual.dao.TCheckInfoDao;

public class QueryTCheckInfoByPagerAction extends ActionImp {
	private Connection con=null;
	private Pager pager=null;
	private int pageSize = 100;
	private int currentPage = 1;
	private String check_no = "";
	private String check_status = "";
	private String begin_date = "";
	private String end_date = "";
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		atx.setErrorContext("EC_COMMON_1004", MessageService.getMessage("EC_COMMON_1004"),"【盘点信息】" ,ex);
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		pager = new Pager(pageSize, currentPage);
		String departIds  = (String)atx.getSessionValue(Constant.SESSION_DEPART_ARRAY);
		ComboPager cp=TCheckInfoDao.queryTCheckInfoByPager(con,pager,check_no,check_status,begin_date,end_date,departIds);
		DaoHelper.setTpersonField(con, cp, "_NAME", "PERSON");
		atx.setValue("T_CHECK_INFO", cp);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		if(atx.getStringValue("PAGE_SIZE")!=null&&!atx.getStringValue("PAGE_SIZE").equals("")){
			pageSize = new Integer(atx.getStringValue("PAGE_SIZE"));
		}
		if(atx.getStringValue("CURRENT_PAGE")!=null&&!atx.getStringValue("CURRENT_PAGE").equals("")){
			currentPage = new Integer(atx.getStringValue("CURRENT_PAGE"));
		}
		
		check_no = atx.getStringValue("CHECK_NO","");
		check_status = atx.getStringValue("CHAGE_STATUS","");
		begin_date = atx.getStringValue("BEGIN_DATE","");
		end_date = atx.getStringValue("END_DATE","");
		return 1;
	}
}
